import Vue from 'vue'
import VueRouter from 'vue-router'
import Layout from '@/components/layout'

Vue.use(VueRouter)
export const asyncRouterMap = []
const routes = [
    {
        path: '/',
        component: Layout,
        redirect: '/home',
        children: [
            {
                path: '/home', // 视图管理 首页
                name: 'Home',
                component: () => import('@/views/viewManage/home'),
            },
            {
                path: '/physical', // 视图管理 物理视图
                name: 'PhysicalView',
                component: () => import('@/views/viewManage/physical'),
            },
            {
                path: '/organizeList', // 设备管理 设备列表
                name: 'OrganizeList',
                component: () => import('@/views/deviceManage/organizeList'),
            },
            {
                path: '/vpn', // 业务编排 vpn
                name: 'Vpn',
                component: () => import('@/views/businessLayout/vpn'),
            },
            {
                path: '/addressNode', // 模板管理地址节点
                name: 'AddressNode',
                component: () => import('@/views/template/addressNode'),
            },
            {
                path: '/addressGroup', // 模板管理地址组
                name: 'AddressGroup',
                component: () => import('@/views/template/addressGroup'),
            },
            {
                path: '/deviceMonitor', // 报表监控 设备监控
                name: 'DeviceMonitor',
                component: () => import('@/views/reportMonitor/deviceMonitor'),
            },
            {
                path: '/tunnelMonitor', // 报表监控 隧道监控
                name: 'TunnelMonitor',
                component: () => import('@/views/reportMonitor/tunnelMonitor'),
            },
            {
                path: '/logBrowse', // 日志警告 日志浏览
                name: 'LogBrowse',
                component: () => import('@/views/warningLog/logBrowse'),
            },
            {
                path: '/userManage',
                name: 'UserManage',
                component: () => import('@/views/settingSystem/userManage'),
            },
        ],
    },
]

const router = new VueRouter({
    mode: 'history',
    base: process.env.BASE_URL,
    routes,
})

export default router
